/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  padding: 15px 50px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo img {
  height: 40px;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin: 0 15px;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #007bff;
}

.nav-links a.active {
  color: #007bff;
  font-weight: bold;
}

.user-actions {
  display: flex;
}

.login-btn,
.register-btn {
  padding: 8px 20px;
  border-radius: 4px;
  text-decoration: none;
  margin-left: 10px;
}

.login-btn {
  background-color: transparent;
  border: 1px solid #007bff;
  color: #007bff;
}

.register-btn {
  background-color: #007bff;
  color: white;
  border: none;
}

/* 主要内容区域样式 */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 轮播图样式 */
.slider {
  position: relative;
  height: 400px;
  overflow: hidden;
  margin-bottom: 40px;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #3498db;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 0 50px;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.slide.active {
  opacity: 1;
}

.slide h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.slide p {
  font-size: 1.2rem;
  margin-bottom: 25px;
}

.cta-btn {
  padding: 12px 30px;
  background-color: white;
  color: #3498db;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s;
}

.cta-btn:hover {
  background-color: #f0f0f0;
}

/* 课程分类样式 */
.categories {
  margin-bottom: 40px;
}

.categories h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  color: #333;
}

.category-cards {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.category-card {
  flex: 0 0 calc(25% - 20px);
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  transition: transform 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card img {
  width: 80px;
  height: 80px;
  margin-bottom: 15px;
}

.category-card h3 {
  color: #007bff;
}

/* 推荐课程样式 */
.featured-courses {
  margin-bottom: 60px;
}

.featured-courses h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  color: #333;
}

.course-cards {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.course-card {
  flex: 0 0 calc(33.33% - 20px);
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  transition: transform 0.3s;
}

.course-card:hover {
  transform: translateY(-5px);
}

.course-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.course-card h3 {
  padding: 15px;
  margin-bottom: 10px;
}

.course-card p {
  padding: 0 15px;
  margin-bottom: 15px;
  color: #666;
}

.course-btn {
  display: block;
  text-align: center;
  padding: 8px 0;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  margin: 0 15px;
  border-radius: 4px;
}

/* 页脚样式 */
footer {
  background-color: #333;
  color: white;
  padding: 40px 0 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.footer-section {
  flex: 1;
  margin-right: 30px;
}

.footer-section:last-child {
  margin-right: 0;
}

.footer-section h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-section p,
.footer-section a {
  color: #ddd;
  margin-bottom: 10px;
  display: block;
  text-decoration: none;
}

.footer-section a:hover {
  color: white;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #444;
  color: #aaa;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 15px;
  }

  .nav-links {
    margin: 15px 0;
  }

  .user-actions {
    width: 100%;
    justify-content: center;
  }

  .slide h2 {
    font-size: 1.8rem;
  }

  .slide p {
    font-size: 1rem;
  }

  .category-cards,
  .course-cards {
    flex-direction: column;
  }

  .category-card,
  .course-card {
    width: 100%;
    margin-bottom: 15px;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-section {
    margin-bottom: 30px;
  }
}
